home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
listings
/
v_08_11
/
8n11088c
< prev
next >
Wrap
Text File
|
1990-09-16
|
561b
|
24 lines
class List {
public:
List() { head = 0; }
~List() {}
Truth isempty() { return head == 0; }
T get() { return head->value(); }
void add(T x) { /* as before */ }
T del() { /* as before */ }
private:
Node *head;
friend It; // It is still a friend of List
// tail returns the tail of the List. cdr in LISP.
List tail()
{
List r;
if( !isempty() )
r.head = head->next();
return r;
}
};